<%@ page pageEncoding="UTF-8" %>
<%@ page import="java.util.Locale "%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>


<html>
<%
Locale l = request.getLocale();
%>

<c:choose> 
  <c:when test="${!(empty param.locale)}"> 
      <c:set var="loc" value="${param.locale}"/>
  </c:when> 
  <c:otherwise> 
    <c:set var="loc" value="<%=l%>"/>
  </c:otherwise> 
</c:choose> 

<fmt:setLocale value="${loc}" />


<fmt:bundle basename="messages">
<head>
<title><fmt:message key="appTitle"/></title>
<link rel="stylesheet" href="./css/index.css" type="text/css" />
</head>
<body>
<h1><fmt:message key="appTitle"/></h1>
<h3><fmt:message key="welcome"/></h3>
<p><fmt:message key="description"/></p>
<code>Locale: ${loc}</code>
</br>
<a href="upload.jsp"><fmt:message key="uploadImage"/></a>
<br/>
<a href="media.jsp">Videos/Photos</a>
<br/>
<a href="comments.jsp">Comments</a>

	
</body>
</fmt:bundle>


</html>










